package service

import (
	httptransport "github.com/go-kit/kit/transport/http"
	"golang.org/x/net/context"
	"net/http"
)

func NewHTTPServer(ctx context.Context, endpoints Endpoints) {
	//m := http.NewServeMux()
	http.Handle("/hash", httptransport.NewServer(
		endpoints.HashEndpoint,
		DecodeHashRequest,
		EncodeResponse,
	))

	http.Handle("/validate", httptransport.NewServer(
		endpoints.ValidateEndpoint,
		DecodeValidateRequest,
		EncodeResponse,
	))

	http.ListenAndServe(":8080", nil)
	//return m
}
